Repository navigation
feat(stv): honor server startup audio hints - #30
Merged
Merged
Conversation
Document the explicit 200 ms startup override and verify larger TTS bursts remain intact. Include transport cancellation tests in the shared CI gate.
mr-wanderer-x
marked this pull request as ready for review
September 28, 2026 12:55
mr-wanderer-x
added a commit
that referenced
this pull request
Sep 28, 2026
Human Presence clients can use smaller audio batches while retaining complete TTS bursts, and traces distinguish queued audio from completed socket writes. This PR contains the Presence SDK work for the small-chunk deployment; the Portrait server-hint work is maintained separately in #30 on `fix/cancel-inflight-audio`. - The documented Presence profile explicitly sets a 320 ms initial threshold, 200 ms subsequent minimum, 100 ms send gap, and `server_feed_fixed_chunk_size=False`. A 1-second TTS burst is sent whole once the threshold is met, subject to the existing transport cap. - Optional exact-size batching preserves complete PCM16 samples and flushes short tails without padding. It is disabled by default. - Cancellation retires the unsent remainder of an old payload even when cancellation completes during pacing or a socket write, preserving the next reply. - Tracing records `audio_queued` and completed `audio_sent`, including duration, queue/pacing wait, and write time. A completed write is not a server acknowledgement. Both WebSocket playback and direct WebRTC use the shared feed. Global defaults remain 1,000 ms initial, 400 ms subsequent, and 200 ms gap; applications opt into the Presence profile. This branch does not consume server startup hints. Version: `0.11.1`. Validation: 255 hermetic tests passed, including both transports at 320 ms, whole-burst preservation, turn rearming, packet/sample boundaries, short tails, and cancellation races. Ruff format/lint, example checks, comment policy, locked dependency install, and wheel/sdist build passed. Pyright reports the same two pre-existing `interaction_messages.py` errors as `main`; CI type checking remains advisory. Live model sessions were not run. The Ojin checkout was left unchanged during this split. Local verification and commits were performed directly because the helper-agent limit was reached; each commit's parent and tree were verified. GitHub verify, examples, and build checks passed on the current head. The only check annotations are GitHub's upcoming Ubuntu runner-image migration notices; these are unrelated to the SDK changes.
mr-wanderer-x
marked this pull request as draft
September 29, 2026 11:07
Keep Portrait's server-advised audio startup alongside Presence batching and cancellation fixes. Preserve whole PCM16 samples when startup recommendations change fixed packet thresholds.
mr-wanderer-x
marked this pull request as ready for review
September 29, 2026 11:11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Avatar replies should not wait for a fixed 1,000 ms of audio when the server can start sooner. Both WebSocket and direct-WebRTC clients now apply the server's startup audio recommendation before replaying buffered TTS.
server_feed_initial_chunk_ms=Noneselects automatic tuning. Valid integer hints from 1–8,000 ms are accepted; missing or invalid hints retain the 1,000 ms fallback. Explicit application settings always win.Merged current main (
aa01226, Presence PR #29) into this branch. Presence's explicit profile, optional exact-size batching, socket-send timing, and cancellation-race fix are preserved. The cancellation implementation is already on main and is not a new change in this PR.Version:
0.12.0(main:0.11.1).Validation: all 286 hermetic unit tests pass, including Portrait and Presence profiles, invalid hints, pre-session audio replay, whole-burst preservation, fixed-size sample alignment, and cancellation during pacing/socket writes. Locked dependency installation, Ruff format/lint, example checks, comment policy, and wheel/sdist builds pass. Pyright reports two existing errors in
interaction_messages.py, which is unchanged from main; the repository's type check is advisory. No live bot/model session or deployment was performed.GitHub verify, examples, and build checks passed on
cd8fc3d. Their only annotations are notices about the upcoming Ubuntu runner-image migration; no product-code finding was reported.